//
//  Labs_DidMovetoParent_Base_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2022/9/9.
//

import UIKit

class Labs_DidMovetoParent_Base_DemoVC: UIViewController {
    /// push完成回调（A push到 B, B拥有该属性）
    open var labs_pushCompletion: (() -> Void)?
    
    /// pop/侧滑返回完成回调（当前VC拥有该属性，即：A push到 B， B侧滑或者点击返回pop回A，B拥有该属性）
    open var labs_popCompletion: (() -> Void)?

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    override func didMove(toParent parent: UIViewController?) {
        super.didMove(toParent: parent)
        if parent == nil {
            guard !isRemoveAfterPushed else {
                return
            }
            labs_popCompletion?()
            popCompletion?()
        } else {
            labs_pushCompletion?()
            pushCompletion?()
//            navigationController?.resetViewControllers()
        }
    }

}
